Make PLT-reduction work with gcc4, and don't include everything in
authorMatthias Clasen <mclasen@redhat.com>
Mon, 14 Mar 2005 19:37:00 +0000 (19:37 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 14 Mar 2005 19:37:00 +0000 (19:37 +0000)
2005-03-14  Matthias Clasen  <mclasen@redhat.com>

Make PLT-reduction work with gcc4, and don't include
everything in gdk-pixbuf-alias.h:

* gdk-pixbuf.symbols: Group symbols by header and source file.
* /makegdkpixbufalias.pl: Protect definitions by the same
preprocessor symbols used to guard the headers. Move
the alias declarations to a separate file which is
produced when calling makegdkpixbufalias.pl -def
* Makefile.am (gdk-pixbuf-aliasdef.c): Add a rule to generate
this file.
* *.c: Include gdk-pixbuf-alias.h after the other headers,
include gdk-pixbuf-aliasdef.c at the bottom.

13 files changed:
gdk-pixbuf/ChangeLog
gdk-pixbuf/Makefile.am
gdk-pixbuf/abicheck.sh
gdk-pixbuf/gdk-pixbuf-animation.c
gdk-pixbuf/gdk-pixbuf-data.c
gdk-pixbuf/gdk-pixbuf-io.c
gdk-pixbuf/gdk-pixbuf-loader.c
gdk-pixbuf/gdk-pixbuf-scale.c
gdk-pixbuf/gdk-pixbuf-util.c
gdk-pixbuf/gdk-pixbuf.c
gdk-pixbuf/gdk-pixbuf.symbols
gdk-pixbuf/gdk-pixdata.c
gdk-pixbuf/makegdkpixbufalias.pl

index c4de18aae9923c70d3467db732d12ada583e1c9e..0fd4f5d5bac5c21e6c6bb7b8c2986ccd16b668bf 100644 (file)
@@ -1,3 +1,18 @@
+2005-03-14  Matthias Clasen  <mclasen@redhat.com>
+
+       Make PLT-reduction work with gcc4, and don't include
+       everything in gdk-pixbuf-alias.h:
+       
+       * gdk-pixbuf.symbols: Group symbols by header and source file.
+       * /makegdkpixbufalias.pl: Protect definitions by the same 
+       preprocessor symbols used to guard the headers. Move
+       the alias declarations to a separate file which is 
+       produced when calling makegdkpixbufalias.pl -def
+       * Makefile.am (gdk-pixbuf-aliasdef.c): Add a rule to generate 
+       this file.
+       * *.c: Include gdk-pixbuf-alias.h after the other headers,
+       include gdk-pixbuf-aliasdef.c at the bottom.
+
 2005-03-10  Tor Lillqvist  <tml@novell.com>
 
        * gdk-pixbuf-core.h
index 02150dc90ef9b9ddf459694d6f80fdb253ebb5fb..9837974c9921ea649c20d31f763d4f219fcfd1fc 100644 (file)
@@ -47,11 +47,14 @@ uninstall-ms-lib:
 endif
 
 gdk_pixbuf.def: gdk-pixbuf.symbols
-       (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 - <$(srcdir)/gdk-pixbuf.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g') > gdk_pixbuf.def
+       (echo -e EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gdk-pixbuf.symbols | sed -e '/^$$/d' -e 's/^/     /' -e 's/G_GNUC_[^ ]*//g') > gdk_pixbuf.def
 
 gdk-pixbuf-alias.h: gdk-pixbuf.symbols
         $(PERL) $(srcdir)/makegdkpixbufalias.pl < $(srcdir)/gdk-pixbuf.symbols > gdk-pixbuf-alias.h
 
+gdk-pixbuf-aliasdef.c: gdk-pixbuf.symbols
+        $(PERL) $(srcdir)/makegdkpixbufalias.pl -def < $(srcdir)/gdk-pixbuf.symbols > gdk-pixbuf-aliasdef.c
+
 if OS_LINUX
 TESTS = abicheck.sh
 endif
@@ -347,6 +350,7 @@ noinst_HEADERS =            \
 
 BUILT_SOURCES =                \
        gdk-pixbuf-alias.h      \
+       gdk-pixbuf-aliasdef.c   \
        gdk-pixbuf-enum-types.h \
        gdk-pixbuf-enum-types.c \
        gdk-pixbuf-marshal.h    \
@@ -385,8 +389,9 @@ MAINTAINERCLEANFILES += s-enum-types-h
 #
 gdk-pixbuf-enum-types.c: @REBUILD@ $(gdk_pixbuf_headers) Makefile
        (cd $(srcdir) && glib-mkenums \
-               --fhead "#include \"gdk-pixbuf-alias.h\"\n#include <gdk-pixbuf/gdk-pixbuf.h>" \
+               --fhead "#include <gdk-pixbuf/gdk-pixbuf.h>\n#include \"gdk-pixbuf-alias.h\"\n" \
                --fprod "\n/* enumerations from \"@filename@\" */" \
+               --ftail "\n#define __GDK_PIXBUF_ENUM_TYPES_C__\n#include \"gdk-pixbuf-aliasdef.c\"" \
                --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"       \
                --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
                --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
@@ -411,7 +416,7 @@ MAINTAINERCLEANFILES += stamp-gdk-pixbuf-marshal.h
 # gdk-pixbuf-marshal.c
 #
 $(srcdir)/gdk-pixbuf-marshal.c: @REBUILD@ $(srcdir)/gdk-pixbuf-marshal.list
-       (echo -e "#include \"gdk-pixbuf-alias.h\"" | $(GLIB_GENMARSHAL) --prefix=_gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --body ) >> xgen-gmc \
+       (echo -e "#include <gdk-pixbuf/gdk-pixbuf.h>\n#include \"gdk-pixbuf-alias.h\"" | $(GLIB_GENMARSHAL) --prefix=_gdk_pixbuf_marshal $(srcdir)/gdk-pixbuf-marshal.list --body ) >> xgen-gmc \
        && cp xgen-gmc gdk-pixbuf-marshal.c \
        && rm -f xgen-gmc xgen-gmc~
 
index 87b59451f8723f11e410654b3b2ada380f9ca23f..989c5e4f2a3fc9abefc05d615250b05cd49518f4 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
 
-cpp -P ${srcdir:-.}/gdk-pixbuf.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE$//' | sort > expected-abi
+cpp -P -DALL_FILES ${srcdir:-.}/gdk-pixbuf.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE$//' | sort > expected-abi
 nm -D .libs/libgdk_pixbuf-2.0.so | grep " T " | cut -d ' ' -f 3 | sort > actual-abi
 diff -u expected-abi actual-abi && rm expected-abi actual-abi
index 2e84d333ac7ea48afac806e9f6f52166c4bc87d1..ad4777416861cfdb49a08f0a24eaacbe958c3cc9 100644 (file)
 
 #include <config.h>
 #include <errno.h>
-#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
 #include "gdk-pixbuf-i18n.h"
 #include "gdk-pixbuf-animation.h"
+#include "gdk-pixbuf-alias.h"
 
 #include <glib/gstdio.h>
 
@@ -822,3 +822,5 @@ gdk_pixbuf_non_anim_iter_advance (GdkPixbufAnimationIter *iter,
         return FALSE;
 }
 
+#define __GDK_PIXBUF_ANIMATION_C__
+#include "gdk-pixbuf-aliasdef.c"
index e8a00765783c46aded82bc6737b208e5ec735bca..1fcf87b84e74f06dff38bbbef854d83c3916b4fe 100644 (file)
@@ -21,9 +21,9 @@
  */
 
 #include <config.h>
-#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf.h"
 #include "gdk-pixbuf-private.h"
+#include "gdk-pixbuf-alias.h"
 #include <stdlib.h>
 #include <string.h>
 
@@ -78,3 +78,6 @@ gdk_pixbuf_new_from_data (const guchar *data, GdkColorspace colorspace, gboolean
 
        return pixbuf;
 }
+
+#define __GDK_PIXBUF_DATA_C__
+#include "gdk-pixbuf-aliasdef.c"
index dbe455b4992d58f1b1b074e1c6a440e7f8d94a1e..653315e26681df609c32aaf413d3c7edc720f565 100644 (file)
@@ -33,9 +33,9 @@
 #include <unistd.h>
 #endif
 
-#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
+#include "gdk-pixbuf-alias.h"
 
 #include <glib/gstdio.h>
 
@@ -906,7 +906,6 @@ gdk_pixbuf_new_from_file (const char *filename,
 #ifdef G_OS_WIN32
 
 #undef gdk_pixbuf_new_from_file
-
 GdkPixbuf *
 gdk_pixbuf_new_from_file (const char *filename,
                           GError    **error)
@@ -2212,6 +2211,9 @@ gdk_pixbuf_get_formats (void)
 }
 
 
+#define __GDK_PIXBUF_IO_C__
+#include "gdk-pixbuf-aliasdef.c"
+
 
 
 
index bccee9fc778d34bb588f2a68eacb77d5fa2411ed..a2a131c4cea94d252333f167c1f48b3b69317fde 100644 (file)
 #include <config.h>
 #include <string.h>
 
-#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-animation.h"
 #include "gdk-pixbuf-io.h"
 #include "gdk-pixbuf-loader.h"
 #include "gdk-pixbuf-marshal.h"
+#include "gdk-pixbuf-alias.h"
 
 enum {
         SIZE_PREPARED,
@@ -807,5 +807,6 @@ gdk_pixbuf_loader_get_format (GdkPixbufLoader *loader)
 }
 
 
-
+#define __GDK_PIXBUF_LOADER_C__
+#include "gdk-pixbuf-aliasdef.c"
 
index d5326a33b5ce2678a1a243534172b8528b35ef70..6ce1fb34fae308ad45999b968ab2e0001c39d863 100644 (file)
@@ -23,9 +23,9 @@
 #include <config.h>
 #include <math.h>
 #include <string.h>
-#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
 #include "pixops/pixops.h"
+#include "gdk-pixbuf-alias.h"
 
 \f
 
@@ -455,3 +455,5 @@ gdk_pixbuf_flip (const GdkPixbuf *src,
   return dest;
 }
                                     
+#define __GDK_PIXBUF_SCALE_C__
+#include "gdk-pixbuf-aliasdef.c"
index 4abca52603d0abb28f9956c3632433cc83c61947..e6fa6f4df91f9678760e7a3361432bfe751e5dc7 100644 (file)
@@ -22,8 +22,8 @@
  */
 
 #include <config.h>
-#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf-private.h"
+#include "gdk-pixbuf-alias.h"
 #include <string.h>
 
 \f
@@ -244,3 +244,7 @@ gdk_pixbuf_saturate_and_pixelate(const GdkPixbuf *src,
                 }
         }
 }
+
+#define __GDK_PIXBUF_UTIL_C__
+#include "gdk-pixbuf-aliasdef.c"
+
index 765c495869401cd0f6bfb2c842e940a75afe7fca..54cb5a5664cc9386930ad08ffe9ad3437a65db6d 100644 (file)
@@ -28,9 +28,9 @@
 #include <stdlib.h>
 #include <string.h>
 #define GDK_PIXBUF_COMPILATION
-#include "gdk-pixbuf-alias.h"
 #include "gdk-pixbuf.h"
 #include "gdk-pixbuf-private.h"
+#include "gdk-pixbuf-alias.h"
 
 static void gdk_pixbuf_class_init   (GdkPixbufClass *klass);
 static void gdk_pixbuf_finalize     (GObject        *object);
@@ -793,3 +793,6 @@ gdk_pixbuf_get_property (GObject         *object,
 /* Include the marshallers */
 #include <glib-object.h>
 #include "gdk-pixbuf-marshal.c"
+
+#define __GDK_PIXBUF_C__
+#include "gdk-pixbuf-aliasdef.c"
index 18cf21d2216f13c9005c09ad601f667cc8fc5175..949757cbe0082cc48bf3d5b291a6152ea2a0bbce 100644 (file)
@@ -1,7 +1,104 @@
-gdk_colorspace_get_type G_GNUC_CONST
-gdk_interp_type_get_type G_GNUC_CONST
+/* This file lists all exported symbols. It is used to generate
+ * the gdk_pixbuf.def file used to control exports on Windows and the
+ * gdk-pixbuf-alias.h/gdk-pixbuf-aliasdef.c files used to avoid PLT 
+ * entries for internal uses of exported functions (see makegdkpixbufalias.pl).
+ * 
+ * Every symbol must be included in the right
+ * #ifdef IN_HEADER(sym) #endif and
+ * #ifdef IN_FILE(sym) #endif sections. 
+ */
+#ifdef ALL_FILES
+#define IN_FILE(x) 1
+#define IN_HEADER(x) 1
+#endif
+#if IN_HEADER(GDK_PIXBUF_CORE_H)
+#if IN_FILE(__GDK_PIXBUF_C__)
+gdk_pixbuf_error_quark
+gdk_pixbuf_get_type G_GNUC_CONST
+#ifndef GDK_PIXBUF_DISABLE_DEPRECATED
+gdk_pixbuf_ref
+gdk_pixbuf_unref
+#endif
+gdk_pixbuf_new
+gdk_pixbuf_get_bits_per_sample
+gdk_pixbuf_get_colorspace
+gdk_pixbuf_get_has_alpha
+gdk_pixbuf_get_height
+gdk_pixbuf_get_n_channels
+gdk_pixbuf_get_pixels
+gdk_pixbuf_get_rowstride
+gdk_pixbuf_get_width
+gdk_pixbuf_get_option
+gdk_pixbuf_copy
+gdk_pixbuf_new_subpixbuf
+gdk_pixbuf_fill
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_CORE_H)
+#if IN_FILE(__GDK_PIXBUF_DATA_C__)
+gdk_pixbuf_new_from_data
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_CORE_H)
+#if IN_FILE(__GDK_PIXBUF_IO_C__)
+gdk_pixbuf_new_from_file PRIVATE
+#ifdef G_OS_WIN32
+gdk_pixbuf_new_from_file_utf8
+#endif
+gdk_pixbuf_new_from_file_at_size PRIVATE
+#ifdef G_OS_WIN32
+gdk_pixbuf_new_from_file_at_size_utf8
+#endif
+gdk_pixbuf_new_from_file_at_scale PRIVATE
+#ifdef G_OS_WIN32
+gdk_pixbuf_new_from_file_at_scale_utf8
+#endif
+gdk_pixbuf_new_from_xpm_data
+gdk_pixbuf_save PRIVATE G_GNUC_NULL_TERMINATED
+#ifdef G_OS_WIN32
+gdk_pixbuf_save_utf8
+#endif
+gdk_pixbuf_save_to_buffer G_GNUC_NULL_TERMINATED
+gdk_pixbuf_save_to_bufferv
+gdk_pixbuf_save_to_callback G_GNUC_NULL_TERMINATED
+gdk_pixbuf_save_to_callbackv
+gdk_pixbuf_savev PRIVATE
+#ifdef G_OS_WIN32
+gdk_pixbuf_savev_utf8
+#endif
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_CORE_H)
+#if IN_FILE(__GDK_PIXDATA_C__)
+gdk_pixbuf_new_from_inline
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_CORE_H)
+#if IN_FILE(__GDK_PIXBUF_UTIL_C__)
 gdk_pixbuf_add_alpha
-gdk_pixbuf_alpha_mode_get_type G_GNUC_CONST
+gdk_pixbuf_copy_area
+gdk_pixbuf_saturate_and_pixelate
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_TRANSFORM_H)
+#if IN_FILE(__GDK_PIXBUF_SCALE_C__)
+gdk_pixbuf_rotate_simple
+gdk_pixbuf_scale
+gdk_pixbuf_scale_simple
+gdk_pixbuf_flip
+gdk_pixbuf_composite
+gdk_pixbuf_composite_color
+gdk_pixbuf_composite_color_simple
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_ANIMATION_H)
+#if IN_FILE(__GDK_PIXBUF_ANIMATION_C__)
 gdk_pixbuf_animation_get_height
 gdk_pixbuf_animation_get_iter
 gdk_pixbuf_animation_get_static_image
@@ -17,17 +114,17 @@ gdk_pixbuf_animation_new_from_file PRIVATE
 #ifdef G_OS_WIN32
 gdk_pixbuf_animation_new_from_file_utf8
 #endif
+#ifndef GDK_PIXBUF_DISABLE_DEPRECATED
 gdk_pixbuf_animation_ref
 gdk_pixbuf_animation_unref
-gdk_pixbuf_composite
-gdk_pixbuf_composite_color
-gdk_pixbuf_composite_color_simple
-gdk_pixbuf_copy
-gdk_pixbuf_copy_area
-gdk_pixbuf_error_get_type 
-gdk_pixbuf_error_quark
-gdk_pixbuf_fill
-gdk_pixbuf_flip
+#endif
+gdk_pixbuf_non_anim_new
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_IO_H)
+#if IN_FILE(__GDK_PIXBUF_IO_C__)
+gdk_pixbuf_get_formats
 gdk_pixbuf_format_get_description
 gdk_pixbuf_format_get_extensions
 gdk_pixbuf_format_get_license
@@ -37,19 +134,18 @@ gdk_pixbuf_format_is_disabled
 gdk_pixbuf_format_is_scalable
 gdk_pixbuf_format_is_writable
 gdk_pixbuf_format_set_disabled
-gdk_pixbuf_from_pixdata
-gdk_pixbuf_get_bits_per_sample
-gdk_pixbuf_get_colorspace
 gdk_pixbuf_get_file_info
-gdk_pixbuf_get_formats
-gdk_pixbuf_get_has_alpha
-gdk_pixbuf_get_height
-gdk_pixbuf_get_n_channels
-gdk_pixbuf_get_option
-gdk_pixbuf_get_pixels
-gdk_pixbuf_get_rowstride
-gdk_pixbuf_get_type G_GNUC_CONST
-gdk_pixbuf_get_width
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_IO_H)
+#if IN_FILE(__GDK_PIXBUF_C__)
+gdk_pixbuf_set_option
+#endif
+#endif
+
+#if IN_HEADER(GDK_PIXBUF_LOADER_H)
+#if IN_FILE(__GDK_PIXBUF_LOADER_C__)
 gdk_pixbuf_loader_close
 gdk_pixbuf_loader_get_animation
 gdk_pixbuf_loader_get_format
@@ -60,51 +156,32 @@ gdk_pixbuf_loader_new_with_mime_type
 gdk_pixbuf_loader_new_with_type
 gdk_pixbuf_loader_set_size
 gdk_pixbuf_loader_write
-gdk_pixbuf_new
-gdk_pixbuf_new_from_data
-gdk_pixbuf_new_from_file PRIVATE
-#ifdef G_OS_WIN32
-gdk_pixbuf_new_from_file_utf8
 #endif
-gdk_pixbuf_new_from_file_at_size PRIVATE
-#ifdef G_OS_WIN32
-gdk_pixbuf_new_from_file_at_size_utf8
-#endif
-gdk_pixbuf_new_from_file_at_scale PRIVATE
-#ifdef G_OS_WIN32
-gdk_pixbuf_new_from_file_at_scale_utf8
 #endif
-gdk_pixbuf_new_from_inline
-gdk_pixbuf_new_from_xpm_data
-gdk_pixbuf_new_subpixbuf
-gdk_pixbuf_non_anim_new
-gdk_pixbuf_ref
-gdk_pixbuf_rotate_simple
+
+#if IN_HEADER(__GDK_PIXBUF_ENUM_TYPES_H__)
+#if IN_FILE(__GDK_PIXBUF_ENUM_TYPES_C__)
+gdk_colorspace_get_type G_GNUC_CONST
+gdk_interp_type_get_type G_GNUC_CONST
+gdk_pixbuf_alpha_mode_get_type G_GNUC_CONST
 gdk_pixbuf_rotation_get_type G_GNUC_CONST
-gdk_pixbuf_saturate_and_pixelate
-gdk_pixbuf_save PRIVATE G_GNUC_NULL_TERMINATED
-#ifdef G_OS_WIN32
-gdk_pixbuf_save_utf8
+gdk_pixbuf_error_get_type 
 #endif
-gdk_pixbuf_save_to_buffer G_GNUC_NULL_TERMINATED
-gdk_pixbuf_save_to_bufferv
-gdk_pixbuf_save_to_callback G_GNUC_NULL_TERMINATED
-gdk_pixbuf_save_to_callbackv
-gdk_pixbuf_savev PRIVATE
-#ifdef G_OS_WIN32
-gdk_pixbuf_savev_utf8
 #endif
-gdk_pixbuf_scale
-gdk_pixbuf_scale_simple
-gdk_pixbuf_set_option
-gdk_pixbuf_unref
+
+#if IN_HEADER(__GDK_PIXDATA_H__)
+#if IN_FILE(__GDK_PIXDATA_C__)
+gdk_pixbuf_from_pixdata
+gdk_pixdata_deserialize
+gdk_pixdata_from_pixbuf
+gdk_pixdata_serialize
+gdk_pixdata_to_csource
+#endif
+#endif
+
 #ifdef INCLUDE_VARIABLES
 gdk_pixbuf_major_version
 gdk_pixbuf_micro_version
 gdk_pixbuf_minor_version
 gdk_pixbuf_version
 #endif
-gdk_pixdata_deserialize
-gdk_pixdata_from_pixbuf
-gdk_pixdata_serialize
-gdk_pixdata_to_csource
index cfe81fa388ef8ef21d6172ddf6878acffd08c8b7..ddafb0ef18d0d3b9a07e1bc5a18586dc9235f79f 100644 (file)
  * Boston, MA 02111-1307, USA.
  */
 #include <config.h>
-#include "gdk-pixbuf-alias.h"
 #include "gdk-pixdata.h"
 
 #include "gdk-pixbuf-private.h"
+#include "gdk-pixbuf-alias.h"
 #include <string.h>
 
 #define APPEND g_string_append_printf
@@ -921,3 +921,6 @@ gdk_pixbuf_new_from_inline (gint          data_length,
 
   return gdk_pixbuf_from_pixdata (&pixdata, copy_pixels, error);
 }
+
+#define __GDK_PIXDATA_C__
+#include "gdk-pixbuf-aliasdef.c"
index 6fbd03094cb7b94669be1d22a86864ffb4a55770..a03da363e970beaf7e6de2245c6a68dd463c8980 100755 (executable)
@@ -1,5 +1,12 @@
 #!/usr/bin/perl -w
 
+my $do_def = 0;
+
+if (($#ARGV >= 0) && ($ARGV[0] eq "-def")) {
+    shift;
+    $do_def = 1;
+}
+
 print <<EOF;
 /* Generated by makegdkpixbufalias.pl */
 
@@ -9,20 +16,28 @@ print <<EOF;
 
 #ifdef G_HAVE_GNUC_VISIBILITY
 
-#ifdef  GDK_PIXBUF_DISABLE_DEPRECATED
-#define WAS_NO_DEPR
-#endif
-#undef  GDK_PIXBUF_DISABLE_DEPRECATED
+EOF
+
+if ($do_def) {
+    print <<EOF
+#undef IN_FILE
+#define IN_FILE defined
 
-#ifdef  G_DISABLE_DEPRECATED
-#define WAS_NO_G_DEPR
-#endif
-#undef  G_DISABLE_DEPRECATED
+#undef IN_HEADER
+#define IN_HEADER(x) 1
 
-#include "gdk-pixbuf.h"
-#include "gdk-pixdata.h"
+EOF
+} 
+else { 
+    print <<EOF
+#define IN_FILE(x) 1
+#define IN_HEADER defined
 
 EOF
+}
+
+my $in_comment = 0;
+my $in_skipped_section = 0;
 
 while (<>) {
 
@@ -58,7 +73,7 @@ while (<>) {
       next;
   }
 
-  if ($_ =~ /^\#ifdef\s+INCLUDE_VARIABLES/)
+  if ($_ =~ /^\#ifdef\s+INCLUDE_VARIABLES|INCLUDE_INTERNAL_SYMBOLS|ALL_FILES/)
   {
       $in_skipped_section = 1;
   }
@@ -68,7 +83,14 @@ while (<>) {
       next;
   }
 
-  if ($_ =~ /^\#ifdef\s+G/)
+  if ($_ =~ /^\#ifn?def\s+G/)
+  {
+      print $_;
+      
+      next;
+  }
+
+  if ($_ =~ /^\#if.*(IN_FILE|IN_HEADER|IN_FILE)/)
   {
       print $_;
       
@@ -90,28 +112,25 @@ while (<>) {
       $attributes = "$attributes $word" unless $word eq "PRIVATE";
   }
   
-  print <<EOF
+  if (!$do_def) {
+    print <<EOF
 extern __typeof ($str) $alias __attribute((visibility("hidden")))$attributes;
-extern __typeof ($str) $str __attribute((alias("$alias"), visibility("default")));
 \#define $str $alias
 
 EOF
+  }
+  else {
+    print <<EOF
+\#undef $str 
+extern __typeof ($str) $str __attribute((alias("$alias"), visibility("default")));
+
+EOF
+  }
 }
 
 print <<EOF;
 
-#ifdef  WAS_NO_DEPR
-#define GDK_PIXBUF_DISABLE_DEPRECATED
-#undef  WAS_NO_DEPR
-#endif
-
-#ifdef  WAS_NO_G_DEPR
-#define G_DISABLE_DEPRECATED
-#undef  WAS_NO_G_DEPR
-#endif
-
 #endif /* G_HAVE_GNUC_VISIBILITY */
-
 #endif /* DISABLE_VISIBILITY */
 EOF